package com.wuhuahe.learning.lagou.service.autodeliver.ribbonrule;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.AbstractLoadBalancerRule;
import com.netflix.loadbalancer.Server;

import java.util.List;

public class MyRule extends AbstractLoadBalancerRule {
    @Override
    public Server choose(Object o) {

        List<Server> allServers = getLoadBalancer().getAllServers();
        allServers.forEach(System.out::println);
        return allServers.get(0);
    }

    @Override
    public void initWithNiwsConfig(IClientConfig iClientConfig) {

    }
}
